MADDriverSettings DriverSettings; // Driver SetUp -- READ ONLY --
/** Current music in memory, loaded with RLoadMusic() by example **/
MADSpec *header; // MAD Header -- READ ONLY --
PatData *partition[ MAXPATTERN]; // Patterns -- READ ONLY --
sData *(sample[ MAXINSTRU][ MAXSAMPLE]); // Instruments -- READ ONLY --
/** Drivers variables **/
Channel chan[ MAXTRACK]; // Current driver channels -- READ ONLY --
Boolean musicEnd; // Is music playing finished? -- READ ONLY --
short Tube[ MAXTRACK]; // Used in 'Tracks View' Window - View menu
short PartitionReader; // Current position in pattern (0...64)
short Pat; // Current ID Pattern, see 'Patterns list'
short PL; // Current position in partition, see 'Partition list'
long VolExt[ MAXTRACK]; // Volumes settings for each track, see 'Adaptators' window. from 0 to 64
long VolGlobal; // Global SOFTWARE volume (This is NOT Mac hardware volume!) from 0 to 64
short speed; // Current speed, see speed Effect
short finespeed; // Current finespeed, see speed Effect
short InstruTube[ MAXINSTRU]; // Used in 'Instrument View' Window - View menu
short VExt; // External music speed, see 'Adaptators' window. 80 = normal
short FreqExt; // External music pitch, see 'Adaptators' window. 80 = normal
Boolean Reading; // Reading indicator
short LeftRight[ MAXTRACK]; // Left/Right % for Deluxe Driver
SndChannelPtr MusicChannelPP; // The SndChannelPtr to apply SndDoCommand, etc.
// ONLY available if you are using SoundManager driver
/** Plugs Import/Export variables **/
PlugInfo *ThePlug; // Pointers on plugs code & infos
short TotalPlug; // no of Plugs in pointer ThePlug
/** Private variables - Not documented **/
/* DO NOT MODIFY OR USE these variables */
long MIN_PITCH, MAX_PITCH;
short smallcounter, trackDiv;
long FREQBASE;
short InstruActif[ MAXINSTRU];
Ptr SysHeapPtr, Vol, IntDataPtr, OscilloWavePtr;
Boolean JumpToNextPattern, endPattern, MADPlay;
long ASCBUFFER;
long BufSize;
long VSYNC, BufCounter, BytesToGenerate;
short vibrato_table[ 64];
short MIDIPortRefNum, gOutNodeRefNum;
SndChannelPtr pseudoChanAWAC;
short InstuNoOld[ MAXTRACK];
short NoteOld[ MAXTRACK];
short VelocityOld[ MAXTRACK];
Boolean TrackLineReading[ MAXTRACK];
SndDoubleBufferHeader TheHeader;
Ptr OverShoot;
long *DASCBuffer;
short *DASCBuffer8;
VBLTask VBL;
long VBLA5;
long mytab[ 12];
long MDelay;
long RDelay;
Ptr ReverbPtr;
};
typedef struct MADDriverRec MADDriverRec;
extern MADDriverRec *MADDriver;
/******************** ***********************/
/*** EFFECTS ID ***/
/******************** ***********************/
enum {
arpeggioE = 0, // 0x00
downslideE = 1, // 0x01
upslideE = 2, // 0x02
portamentoE = 3, // 0x03
vibratoE = 4, // 0x04
portaslideE = 5, // 0x05
vibratoslideE = 6, // 0x06
nothingE = 7, // 0x07
offsetE = 9, // 0x08
slidevolE = 10, // 0x0A
fastskipE = 11, // 0x0B
volumeE = 12, // 0x0C
skipE = 13, // 0x0D
extendedE = 14, // 0x0E
speedE = 15 // 0x0F
};
/******************** ***********************/
/*** FUNCTIONS ***/
/******************** ***********************/
#ifdef __cplusplus
extern "C" {
#endif
OSErr MADInitLibrary( Str255 PlugsFolderName, Boolean SysMemory); // Library initialisation, you have to CALL this function if you want to use other functions & variables
OSErr MADDisposeLibrary( void); // Close Library, close music, close driver, free all memory
void MADGetBestDriver( MADDriverSettings *DriverInitParam); // Found and identify the current Mac sound hardware and fill DriverInitParam
OSErr MADCreateDriver( MADDriverSettings *DriverInitParam); // Music Driver initialization and memory allocation
OSErr MADDisposeDriver(); // Dispose the music driver, use it after RInitMusic()
OSErr MADPlay( void); // Play the current music
OSErr MADStop( void); // Stop the current music
OSErr MADReset( void); // Reset the current music at the start position
OSErr MADGetMusicStatus( long *fullTime, long *curTime); // Get informations about music position and duration
OSErr MADSetHardwareVolume( long); // 0...64, Mac HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
long MADGetHardwareVolume(); // Return HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
OSErr MADLoadMusicFile( Str255 fName); // Load a MAD File in the current directory
OSErr MADLoadMusicFSpFile( FSSpec *theSpec); // Same as above but with a FSSpec pointer
OSErr MADLoadMusicRsrc( OSType IDName, short IDNo); // Load a MAD Rsrc into memory
OSErr MADLoadMusicPtr( Ptr myPtr); // Load a MAD Ptr into memory, you can DisposPtr your Ptr after this call
OSErr MADLoadMusicPartition( MADPartition *aPartition); // Load a MAD partition into memory
OSErr MADImportMusicFile( OSType plugType, Str255 fName); // Import a non-MAD music file with plugs
OSErr MADImportMusicFSpFile( OSType plugType, FSSpec *theSpec); // Same as above but with a FSSpec pointer
OSErr MADMusicIdentify( OSType *type, Str255 fName); // Identify what kind of music format is fName file.
OSErr MADMusicIdentifyFSp( OSType *type, FSSpec *theSpec); // Same as above but with a FSSpec pointer
Boolean MADPlugAvailable( OSType type); // Is plug 'type' available?
OSErr MADDisposeMusic(void); // Dispose the current music, use it after RLoadMusic(), RLoadMusicRsrc(), RInstallMADF()
void MADChangeTracks( short); // Change current tracks number of the music driver
void MADCleanDriver( MADDriverRec *intDriver); // Clean the driver : stop playing sounds
Cmd* GetMADCommand( short position, // Extract a Command from a PatData structure
short channel,
PatData* aPatData);
OSErr MADPlaySndHandle( Handle sound, // Handle to a 'snd ' handle, by ex: GetResource('snd ', 128);
long chan, // channel ID on which to play sound
long note); // note: 0 to NUMBER_NOTES or 0xFF: play sound at his normal sampleRate Khz
OSErr MADPlaySoundData( Ptr soundPtr, // Sound Pointer to data
long size, // Sound size in bytes
long channel, // channel ID on which to play sound
long note, // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
long amplitude, // 8 or 16 bits
long loopBeg, // loop beginning
long loopSize, // loop size in bytes
unsigned long rate); // sample rate of the sound data, by ex: rate22khz
OSErr MADPlaySoundDataSYNC(Ptr soundPtr, // Sound Pointer to data
long size, // Sound size in bytes
long channel, // channel ID on which to play sound
long note, // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
long amplitude, // 8 or 16 bits
long loopBeg, // loop beginning
long loopSize, // loop size in bytes
unsigned long rate); // sample rate of the sound data, by ex: rate22khz